<!-- 系统设置 -->
<template>
    <view class="sustem-setting">
        <van-cell-group inset border>
            <van-cell title="账号注销">
                <template #title>
                    <span class="custom-title">修改绑定手机号</span>
                </template>
                <template #right-icon>
                    <span @click="updateIphoneNumber()"><van-icon name="arrow" /></span>
                </template>
            </van-cell>
        </van-cell-group>
        <van-cell-group inset border>
            <van-cell title="账号注销">
                <template #title>
                    <span class="custom-title">账号注销</span>
                </template>
                <template #right-icon>
                    <span @click="accountCancellation()"><van-icon name="arrow" /></span>
                </template>
            </van-cell>
        </van-cell-group>
        <van-dialog v-model:show="state.show" title="标题" show-cancel-button confirmButtonColor="#3478F5"
            cancelButtonColor="#7A7A7A" confirmButtonText="我再想想" cancelButtonText="注销账号" @confirm="state.show = false"
            @cancel="confirm()">
            <div class="dia-log-txt">确认注销账号吗？账号注销后将清除所有与账户相关的信息，请谨慎操作</div>
        </van-dialog>
    </view>
</template>
    
<script setup>
import { reactive, getCurrentInstance, onMounted } from "vue"
import { getAuthorization, setAuthorization } from "@/utils/auth.js"
import { onLoad } from '@dcloudio/uni-app'
import PhotoListItem from "@/components/photoListItem/index.vue"
import { showConfirmDialog } from 'vant';

let { proxy } = getCurrentInstance()

const state = reactive({
    show: false,
    curIndex: false,
    isEdit: false,
    username: '',
})

onLoad((options) => {

})

const accountCancellation = (action) => {
    state.show = true
}

const confirm = () => {
    // 注销账号
    uni.navigateTo({
        url: "/pages/login/verificationCode/index"
    })
}

const updateIphoneNumber = async (item) => {
    // 修改手机号
    uni.navigateTo({
        url: "/pages/login/verificationCode/index?type=3"
    })

}

</script>
    
<style lang="scss" scoped>
.sustem-setting {
    padding-top: 30rpx;
    min-height: 100vh;
    background: #F7F8F9;
}

.van-cell-group {
    margin-bottom: 30rpx;
}

.dia-log-txt {
    padding: 30rpx
}
</style>
    